package lab01;
import java.util.Scanner;
public class Text08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请任意输入一个1~~100之间的数");
        int guessNum = (int)(Math.random()*100 )+1;
        int count = 0 ;
        while(true){
            count++;//计数的作用
            int result = sc.nextInt();
            if(guessNum < result){
                System.out.println("猜大了");
            }else if(guessNum > result){
                System.out.println("猜小了");
            }else{
                System.out.println("猜中了");
                System.out.println("time is" + count +","+ "guessNum is "+ result);
                break;
            }
        }
    }
}
